//
//  SnowViewController
//  ProtoParticle
//
//  Created by Rebouh Aymen on 08/03/2017.
//  Copyright © 2017 Aymen. All rights reserved.
//

import UIKit

class SnowViewController: UIViewController {

    // MARK: - Lifecycle -
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        let animationType = SnowAnimation()
        let emitterLayer = animationType.emitter()
        
////要限定粒子动画的显示区域，需要：
//        emitterLayer.frame = CGRect(x: 0, y: 0, width:UIScreen.main.bounds.width , height: UIScreen.main.bounds.height/2)
//        emitterLayer.masksToBounds = true
        
//或者设定emitterCell的contentRect
        
        view.layer.addSublayer(emitterLayer)
    }
}

